#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "user.h"
#include "room.h"
#include "costumer.h"
#include "bill.h"

int receptMenu()
{
	int c;
	printf("\t\t\t    Hetol Management       \n");
	printf("\t\t\t*************************************\n");
	printf("\t\t\t    Administrator System\n");
	printf("\t\t\t    1 : find rooms\n");
	printf("\t\t\t    2 : live in\n");
	printf("\t\t\t    3 : check\n");
	printf("\t\t\t    4 : out room\n");
	printf("\t\t\t    5 : rechange room\n");
	printf("\t\t\t    6 : keep room\n");
	printf("\t\t\t    7 : show costumer\n");
	printf("\t\t\t    8 : change self\n");
	printf("\t\t\t    0 : quit\n");
	printf("\t\t\t*************************************\n");
	printf("select:");
	scanf("%d",&c);
	getchar();
	while(c<0 || c>8)
	{
		printf("you input is wrong,please enter again!\n");
		scanf("%d",&c);
		getchar();
	}
	return c;
}

void receptsystem(User *r)
{
	int c,loop = 1;
//	User *pr;
	Bill *ps;
	Room *pt;
	Costumer *pr;
	while(loop)
	{
		system("clear");
		//showTime(1);
		printf("%s\n",r->userId);
		c = receptMenu();
		switch(c){
			case 1:pt = read_room();
			find_room(pt);
			break;
			case 2:pt = read_room();
			add_costumer(pt);
			break;
			case 3:check_bill(pt,pr,ps);
			break;
/*			case 4:pt = read_room();
			display_room(pt);
			break;*/
			case 5:pt = read_room();
			ps = read_bill();
			rechange_room(pt,ps);
			break;
/*			case 6:pt = read_room();
			remove_room(pt);
			break;*/
			case 7:pr = read_costumer();
			display_costumer(pr);
			break;
			case 8:
			break;
			default:
			loop = 0;
		}//switch
	}//while
}